import request from '@/utils/request'

export function getMerchantProfile(id) {
    return request({
        url: '/api/merchant/get.do',
        method: 'get',
        params: { id }  // ✅ 使用 query 参数
    })
}

// 更新用户资料
export function updateMerchantProfile(data) {
    return request({
        url: '/api/merchant/update.do',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}

// 修改密码
export function changePassword(data) {
    return request({
        url: '/api/merchant/resetPassword.do',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}

// 上传头像
export function uploadImage(data) {
    return request({
        url: '/api/merchant/uploadImage.do',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        }
    })
}
